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

Side by Side Diff: chrome/renderer/extensions/extension_dispatcher.cc

Issue 10694085: Refactor extension event distribution to use Values instead of JSON strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix. Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/extension_dispatcher.h" 5 #include "chrome/renderer/extensions/extension_dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 using extensions::TTSCustomBindings; 101 using extensions::TTSCustomBindings;
102 using extensions::TabFinder; 102 using extensions::TabFinder;
103 using extensions::TabsCustomBindings; 103 using extensions::TabsCustomBindings;
104 using extensions::UpdatedExtensionPermissionsInfo; 104 using extensions::UpdatedExtensionPermissionsInfo;
105 using extensions::WebRequestCustomBindings; 105 using extensions::WebRequestCustomBindings;
106 106
107 namespace { 107 namespace {
108 108
109 static const int64 kInitialExtensionIdleHandlerDelayMs = 5*1000; 109 static const int64 kInitialExtensionIdleHandlerDelayMs = 5*1000;
110 static const int64 kMaxExtensionIdleHandlerDelayMs = 5*60*1000; 110 static const int64 kMaxExtensionIdleHandlerDelayMs = 5*60*1000;
111 static const char kEventDispatchFunction[] = "Event.dispatchJSON"; 111 static const char kEventDispatchFunction[] = "Event.dispatch";
112 static const char kOnUnloadEvent[] = "runtime.onSuspend"; 112 static const char kOnUnloadEvent[] = "runtime.onSuspend";
113 113
114 class ChromeHiddenNativeHandler : public NativeHandler { 114 class ChromeHiddenNativeHandler : public NativeHandler {
115 public: 115 public:
116 ChromeHiddenNativeHandler() { 116 ChromeHiddenNativeHandler() {
117 RouteFunction("GetChromeHidden", 117 RouteFunction("GetChromeHidden",
118 base::Bind(&ChromeHiddenNativeHandler::GetChromeHidden, 118 base::Bind(&ChromeHiddenNativeHandler::GetChromeHidden,
119 base::Unretained(this))); 119 base::Unretained(this)));
120 } 120 }
121 121
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 // APIs, they don't get extension bindings injected. If we end up here it 1031 // APIs, they don't get extension bindings injected. If we end up here it
1032 // means that a sandboxed page somehow managed to invoke an API anyway, so 1032 // means that a sandboxed page somehow managed to invoke an API anyway, so
1033 // we should abort. 1033 // we should abort.
1034 WebKit::WebFrame* frame = context->web_frame(); 1034 WebKit::WebFrame* frame = context->web_frame();
1035 ExtensionURLInfo url_info(frame->document().securityOrigin(), 1035 ExtensionURLInfo url_info(frame->document().securityOrigin(),
1036 UserScriptSlave::GetDataSourceURLForFrame(frame)); 1036 UserScriptSlave::GetDataSourceURLForFrame(frame));
1037 CHECK(!extensions_.IsSandboxedPage(url_info)); 1037 CHECK(!extensions_.IsSandboxedPage(url_info));
1038 1038
1039 return true; 1039 return true;
1040 } 1040 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698