OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // This module provides --site-per-process overrides for WebView (<webview>). | |
6 // See web_view.js for details. | |
7 | |
8 var IdGenerator = requireNative('id_generator'); | |
9 var WebViewImpl = require('webView').WebViewImpl; | |
10 // NOTE: Do not remove these, we implicitly depend on these in | |
11 // --site-per-process. | |
12 var GuestViewIframe = require('guestViewIframe'); | |
13 var GuestViewIframeContainer = require('guestViewIframeContainer'); | |
14 | |
15 WebViewImpl.prototype.attachWindow$ = function(opt_guestInstanceId) { | |
16 // If |opt_guestInstanceId| was provided, then a different existing guest is | |
17 // being attached to this webview, and the current one will get destroyed. | |
18 if (opt_guestInstanceId) { | |
19 if (this.guest.getId() == opt_guestInstanceId) { | |
20 return true; | |
21 } | |
22 this.guest.destroy(); | |
23 this.guest = new GuestView('webview', opt_guestInstanceId); | |
24 } | |
25 | |
26 var generatedID = IdGenerator.GetNextId(); | |
Fady Samuel
2015/06/09 03:16:32
nit: generatedId
lazyboy
2015/06/09 18:48:23
Done.
| |
27 // We do have a plugin to set our instance id, so do it here. | |
Fady Samuel
2015/06/09 03:16:32
I wouldn't mention plugin here at all. Simply say
lazyboy
2015/06/09 18:48:23
Done.
| |
28 this.onInternalInstanceID(generatedID); | |
Fady Samuel
2015/06/09 03:16:32
nit: Id
lazyboy
2015/06/09 18:48:23
Done.
| |
29 return true; | |
30 }; | |
OLD | NEW |