Skip to content

Commit 7aac46e

Browse files
rogerwangrichardcypher
authored andcommitted
[devtools] use separate process correctly
In Ubuntu 12 VM for some reason SiteInstanceImpl::GetProcess is called multiple times later in LoadURL and we should unpin renderer correctly content::SiteInstanceImpl::GetProcess() content::SiteInstanceImpl::HasWrongProcessForURL() content::RenderViewHostManager::GetSiteInstanceForEntry() content::RenderViewHostManager::UpdateRendererStateForNavigate() content::RenderViewHostManager::Navigate() content::NavigationControllerImpl::NavigateToPendingEntry() content::NavigationControllerImpl::LoadEntry() content::NavigationControllerImpl::LoadURLWithParams() content::NavigationControllerImpl::LoadURL() content::SiteInstanceImpl::GetProcess() content::RenderViewHostImpl::RenderViewHostImpl() content::RenderViewHostFactory::Create() content::RenderViewHostManager::CreateRenderView() content::RenderViewHostManager::UpdateRendererStateForNavigate() content::RenderViewHostManager::Navigate() content::NavigationControllerImpl::NavigateToPendingEntry() content::NavigationControllerImpl::LoadEntry() content::NavigationControllerImpl::LoadURLWithParams() content::NavigationControllerImpl::LoadURL() fix bugs of useragentapp and datapath
1 parent 27d9356 commit 7aac46e

File tree

9 files changed

+8
-41
lines changed

9 files changed

+8
-41
lines changed

src/nw_shell.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,16 @@ void Shell::ShowDevTools(const char* jail_id, bool headless) {
359359
WebContents::CreateParams create_params(web_contents()->GetBrowserContext(), NULL);
360360
WebContents* web_contents = WebContents::Create(create_params);
361361
Shell* shell = new Shell(web_contents, &manifest);
362-
browser_context->set_pinning_renderer(true);
363362

364363
int rh_id = shell->web_contents_->GetRenderProcessHost()->GetID();
365364
ChildProcessSecurityPolicyImpl::GetInstance()->GrantScheme(rh_id, chrome::kFileScheme);
366365
shell->is_devtools_ = true;
367366
shell->force_close_ = true;
368367
shell->LoadURL(url);
369368

369+
// LoadURL() could allocate new SiteInstance so we have to pin the
370+
// renderer after it
371+
browser_context->set_pinning_renderer(true);
370372
// Save devtools window in current shell.
371373
devtools_window_ = shell->weak_ptr_factory_.GetWeakPtr();
372374
#endif

tests/automatic_tests/datapath/datacash-path/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ <h1>Testing data path</h1>
1515
data: "ok"
1616
});
1717
document.write(info);
18+
gui.Window.get().close();
1819
</script>
1920
</body>
2021
</html>

tests/automatic_tests/datapath/datacash/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ <h1>Testing data path</h1>
1515
data: "ok"
1616
});
1717
document.write(info);
18+
gui.Window.get().close();
1819
</script>
1920
</body>
2021
</html>

tests/automatic_tests/datapath/datapath-cash/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ <h1>Testing data path</h1>
1515
data: "ok"
1616
});
1717
document.write(info);
18+
gui.Window.get().close();
1819
</script>
1920
</body>
2021
</html>

tests/automatic_tests/datapath/datapath/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ <h1>Testing data path</h1>
1515
data: "ok"
1616
});
1717
document.write(info);
18+
gui.Window.get().close();
1819
</script>
1920
</body>
2021
</html>

tests/automatic_tests/datapath/index.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/automatic_tests/datapath/mocha_test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var assert = require('assert');
22
var fs = require('fs');
33
var path = require('path');
4+
var gui = require('nw.gui');
45
var app_test = require('./nw_test_app');
56
describe('data-path', function() {
67
it('setting datapath as ./data-cash/ should pass',
@@ -10,7 +11,6 @@ describe('data-path', function() {
1011
execPath: process.execPath,
1112
appPath: path.join(global.tests_dir, 'datapath/datacash'),
1213
end: function(data, app) {
13-
app.kill();
1414
done();
1515
}
1616
});
@@ -23,7 +23,6 @@ describe('data-path', function() {
2323
execPath: process.execPath,
2424
appPath: path.join(global.tests_dir, 'datapath/datapath'),
2525
end: function(data, app) {
26-
app.kill();
2726
done();
2827
}
2928
});
@@ -36,7 +35,6 @@ describe('data-path', function() {
3635
execPath: process.execPath,
3736
appPath: path.join(global.tests_dir, 'datapath/datapath-cash'),
3837
end: function(data, app) {
39-
app.kill();
4038
done();
4139
}
4240
});
@@ -49,7 +47,6 @@ describe('data-path', function() {
4947
execPath: process.execPath,
5048
appPath: path.join(global.tests_dir, 'datapath/datacash-path'),
5149
end: function(data, app) {
52-
app.kill();
5350
done();
5451
}
5552
});

tests/automatic_tests/datapath/package.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/automatic_tests/user-agent-app/popup.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)