| OLD | NEW |
| 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 Loading... |
| 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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 // APIs, they don't get extension bindings injected. If we end up here it | 1023 // APIs, they don't get extension bindings injected. If we end up here it |
| 1024 // means that a sandboxed page somehow managed to invoke an API anyway, so | 1024 // means that a sandboxed page somehow managed to invoke an API anyway, so |
| 1025 // we should abort. | 1025 // we should abort. |
| 1026 WebKit::WebFrame* frame = context->web_frame(); | 1026 WebKit::WebFrame* frame = context->web_frame(); |
| 1027 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1027 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
| 1028 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1028 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
| 1029 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1029 CHECK(!extensions_.IsSandboxedPage(url_info)); |
| 1030 | 1030 |
| 1031 return true; | 1031 return true; |
| 1032 } | 1032 } |
| OLD | NEW |