Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Side by Side Diff: extensions/renderer/display_source_custom_bindings.cc

Issue 1866103002: [Extensions] Expand bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | extensions/renderer/i18n_custom_bindings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/renderer/display_source_custom_bindings.h" 5 #include "extensions/renderer/display_source_custom_bindings.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "content/public/child/v8_value_converter.h" 10 #include "content/public/child/v8_value_converter.h"
(...skipping 11 matching lines...) Expand all
22 const char kErrorNotSupported[] = "Not supported"; 22 const char kErrorNotSupported[] = "Not supported";
23 const char kInvalidStreamArgs[] = "Invalid stream arguments"; 23 const char kInvalidStreamArgs[] = "Invalid stream arguments";
24 const char kSessionAlreadyStarted[] = "The session has been already started"; 24 const char kSessionAlreadyStarted[] = "The session has been already started";
25 const char kSessionAlreadyTerminating[] = "The session is already terminating"; 25 const char kSessionAlreadyTerminating[] = "The session is already terminating";
26 const char kSessionNotFound[] = "Session not found"; 26 const char kSessionNotFound[] = "Session not found";
27 } // namespace 27 } // namespace
28 28
29 DisplaySourceCustomBindings::DisplaySourceCustomBindings(ScriptContext* context) 29 DisplaySourceCustomBindings::DisplaySourceCustomBindings(ScriptContext* context)
30 : ObjectBackedNativeHandler(context), 30 : ObjectBackedNativeHandler(context),
31 weak_factory_(this) { 31 weak_factory_(this) {
32 RouteFunction("StartSession", 32 RouteFunction("StartSession", "displaySource",
33 base::Bind(&DisplaySourceCustomBindings::StartSession, 33 base::Bind(&DisplaySourceCustomBindings::StartSession,
34 weak_factory_.GetWeakPtr())); 34 weak_factory_.GetWeakPtr()));
35 RouteFunction("TerminateSession", 35 RouteFunction("TerminateSession", "displaySource",
36 base::Bind(&DisplaySourceCustomBindings::TerminateSession, 36 base::Bind(&DisplaySourceCustomBindings::TerminateSession,
37 weak_factory_.GetWeakPtr())); 37 weak_factory_.GetWeakPtr()));
38 } 38 }
39 39
40 DisplaySourceCustomBindings::~DisplaySourceCustomBindings() { 40 DisplaySourceCustomBindings::~DisplaySourceCustomBindings() {
41 } 41 }
42 42
43 void DisplaySourceCustomBindings::Invalidate() { 43 void DisplaySourceCustomBindings::Invalidate() {
44 session_map_.clear(); 44 session_map_.clear();
45 weak_factory_.InvalidateWeakPtrs(); 45 weak_factory_.InvalidateWeakPtrs();
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 298
299 void DisplaySourceCustomBindings::OnSessionError(int sink_id, 299 void DisplaySourceCustomBindings::OnSessionError(int sink_id,
300 DisplaySourceErrorType type, 300 DisplaySourceErrorType type,
301 const std::string& message) { 301 const std::string& message) {
302 CHECK(GetDisplaySession(sink_id)); 302 CHECK(GetDisplaySession(sink_id));
303 DispatchSessionError(sink_id, type, message); 303 DispatchSessionError(sink_id, type, message);
304 } 304 }
305 305
306 } // extensions 306 } // extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | extensions/renderer/i18n_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698