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

Unified Diff: chrome/renderer/extensions/webview_custom_bindings.cc

Issue 23514016: <webview>: Cleanup WebRequest event listeners when embedder destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed WebRequest unit test Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/webview_custom_bindings.cc
diff --git a/chrome/renderer/extensions/webview_custom_bindings.cc b/chrome/renderer/extensions/webview_custom_bindings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e45ebf3b2e4d088af522ecda7515b97acbff846a
--- /dev/null
+++ b/chrome/renderer/extensions/webview_custom_bindings.cc
@@ -0,0 +1,28 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/renderer/extensions/webview_custom_bindings.h"
+
+#include <string>
+
+#include "base/bind.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+
+WebViewCustomBindings::WebViewCustomBindings(
+ Dispatcher* dispatcher, ChromeV8Context* context)
+ : ChromeV8Extension(dispatcher, context) {
+ RouteFunction("GetNextInstanceID",
+ base::Bind(&WebViewCustomBindings::GetNextInstanceID,
+ base::Unretained(this)));
+}
+
+void WebViewCustomBindings::GetNextInstanceID(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ static int next_instance_id = 1;
+ args.GetReturnValue().Set(next_instance_id++);
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/renderer/extensions/webview_custom_bindings.h ('k') | chrome/renderer/resources/extensions/web_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698