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

Issue 23835007: DevTools: Do not close devtools if there are dirty files in workspace (Closed)

Created:
7 years, 3 months ago by lushnikov
Modified:
7 years, 1 month ago
CC:
chromium-reviews, Avi (use Gerrit), creis+watch_chromium.org, ajwong+watch_chromium.org, jam, yurys, joi+watch-content_chromium.org, paulirish+reviews_chromium.org, darin-cc_chromium.org, devtools-reviews_chromium.org, aandrey+blink_chromium.org, pfeldman, miu+watch_chromium.org
Visibility:
Public.

Description

Devtools workspace feature means that a developer can lose unsaved changes if the inspected page or browser gets closed. This CL adds a warning dialog which is displayed in these cases by devtools if the workspace is dirty. The dialog is displayed by chaining a Devtools beforeunload handler before the content's beforeunload handler. Plumbing is added to support said chaining. For a more detailed overview, see comments in devtools_window.h BUG=289552 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235475

Patch Set 1 #

Patch Set 2 : refactoring #

Patch Set 3 : reupload #

Total comments: 9

Patch Set 4 : addressed most of the comments #

Patch Set 5 : revisiting patch #

Patch Set 6 : rebaseline & revisiting #

Patch Set 7 : adding test cases #

Patch Set 8 : simplify test case #

Patch Set 9 : update testcases and add debug info for the bot #

Patch Set 10 : fixing tests & unload controller #

Patch Set 11 : fix races in tests #

Patch Set 12 : attempt to fix race condition on TestDevToolsOnDevTools #

Patch Set 13 : rebaseline #

Patch Set 14 : attempt #2 to fix races in TestDevToolsOnDevTools #

Patch Set 15 : improving TestDevToolsOnDevTools test #

Total comments: 8

Patch Set 16 : addressed comments #

Total comments: 1

Patch Set 17 : improved unit test coverage #

Patch Set 18 : refactoring #

Patch Set 19 : fix test typos #

Total comments: 3

Patch Set 20 : mitigate DevTools use in tab_strip_model #

Patch Set 21 : fix win compile #

Total comments: 24

Patch Set 22 : Address Jeremy's comments #

Total comments: 14

Patch Set 23 : revisiting naming & comments #

Total comments: 23

Patch Set 24 : addressing comments #

Total comments: 30

Patch Set 25 : Address Jeremy's comments #

Total comments: 12

Patch Set 26 : Addressing final Jeremy's comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+509 lines, -34 lines) Patch
M chrome/browser/devtools/devtools_sanity_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 chunks +212 lines, -22 lines 0 comments Download
M chrome/browser/devtools/devtools_window.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +79 lines, -0 lines 0 comments Download
M chrome/browser/devtools/devtools_window.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 chunks +91 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 2 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser_tab_strip_model_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser_tab_strip_model_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/fast_unload_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/fast_unload_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 9 chunks +41 lines, -5 lines 0 comments Download
M chrome/browser/ui/tabs/tab_strip_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/tabs/tab_strip_model_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/tabs/test_tab_strip_model_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/unload_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/unload_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 7 chunks +45 lines, -3 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
vsevik
https://codereview.chromium.org/23835007/diff/7001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): https://codereview.chromium.org/23835007/diff/7001/chrome/browser/devtools/devtools_window.cc#newcode309 chrome/browser/devtools/devtools_window.cc:309: return window ? window : NULL; return window https://codereview.chromium.org/23835007/diff/7001/chrome/browser/devtools/devtools_window.cc#newcode827 ...
7 years, 3 months ago (2013-09-11 11:51:12 UTC) #1
lushnikov
https://codereview.chromium.org/23835007/diff/7001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): https://codereview.chromium.org/23835007/diff/7001/chrome/browser/devtools/devtools_window.cc#newcode309 chrome/browser/devtools/devtools_window.cc:309: return window ? window : NULL; On 2013/09/11 11:51:13, ...
7 years, 3 months ago (2013-09-11 14:03:09 UTC) #2
lushnikov
PTAL
7 years, 3 months ago (2013-09-11 17:07:20 UTC) #3
lushnikov
Vsevik, please take a look on this patch from the DevTools point of view
7 years, 1 month ago (2013-10-28 13:26:44 UTC) #4
lushnikov
7 years, 1 month ago (2013-11-01 16:39:24 UTC) #5
vsevik
https://chromiumcodereview.appspot.com/23835007/diff/424001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/424001/chrome/browser/devtools/devtools_window.cc#newcode601 chrome/browser/devtools/devtools_window.cc:601: DevToolsWindow *window = AsDevToolsWindow(contents->GetRenderViewHost()); remove this https://chromiumcodereview.appspot.com/23835007/diff/424001/chrome/browser/devtools/devtools_window.cc#newcode625 chrome/browser/devtools/devtools_window.cc:625: // ...
7 years, 1 month ago (2013-11-05 08:36:16 UTC) #6
lushnikov
Fixed nits https://chromiumcodereview.appspot.com/23835007/diff/424001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/424001/chrome/browser/devtools/devtools_window.cc#newcode601 chrome/browser/devtools/devtools_window.cc:601: DevToolsWindow *window = AsDevToolsWindow(contents->GetRenderViewHost()); On 2013/11/05 08:36:17, ...
7 years, 1 month ago (2013-11-05 12:12:07 UTC) #7
vsevik
devtools lgtm https://chromiumcodereview.appspot.com/23835007/diff/494001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/494001/chrome/browser/devtools/devtools_window.cc#newcode619 chrome/browser/devtools/devtools_window.cc:619: void DevToolsWindow::PageCancelClose(content::WebContents* contents) { PageClosingCanceled
7 years, 1 month ago (2013-11-05 12:23:29 UTC) #8
vsevik
Let's make several tests with the following scenario: 1) Open certain type of devtools (docked/undocked) ...
7 years, 1 month ago (2013-11-05 12:44:16 UTC) #9
lushnikov
@vsevik: improved test coverage
7 years, 1 month ago (2013-11-05 14:52:53 UTC) #10
lushnikov
Here's an overview of what's going on in this patch: http://goo.gl/dlHsSy @playmobil: please, take a ...
7 years, 1 month ago (2013-11-05 14:58:11 UTC) #11
sky
https://chromiumcodereview.appspot.com/23835007/diff/514004/chrome/browser/ui/tabs/tab_strip_model.cc File chrome/browser/ui/tabs/tab_strip_model.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/514004/chrome/browser/ui/tabs/tab_strip_model.cc#newcode1206 chrome/browser/ui/tabs/tab_strip_model.cc:1206: if (DevToolsWindow::GetInstanceForInspectedRenderViewHost( If you are going to tie the ...
7 years, 1 month ago (2013-11-05 16:37:09 UTC) #12
lushnikov
https://chromiumcodereview.appspot.com/23835007/diff/514004/chrome/browser/ui/tabs/tab_strip_model.cc File chrome/browser/ui/tabs/tab_strip_model.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/514004/chrome/browser/ui/tabs/tab_strip_model.cc#newcode1206 chrome/browser/ui/tabs/tab_strip_model.cc:1206: if (DevToolsWindow::GetInstanceForInspectedRenderViewHost( On 2013/11/05 16:37:10, sky wrote: > If ...
7 years, 1 month ago (2013-11-05 17:27:21 UTC) #13
lushnikov
@creis: please take a look on this patch as unload-process guru
7 years, 1 month ago (2013-11-06 12:28:13 UTC) #14
lushnikov
https://chromiumcodereview.appspot.com/23835007/diff/514004/chrome/browser/ui/tabs/tab_strip_model.cc File chrome/browser/ui/tabs/tab_strip_model.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/514004/chrome/browser/ui/tabs/tab_strip_model.cc#newcode1206 chrome/browser/ui/tabs/tab_strip_model.cc:1206: if (DevToolsWindow::GetInstanceForInspectedRenderViewHost( On 2013/11/05 17:27:22, lushnikov wrote: > On ...
7 years, 1 month ago (2013-11-06 17:01:40 UTC) #15
jeremy
At a first glance the general approach looks fine, but this needs way more comments. ...
7 years, 1 month ago (2013-11-07 14:18:33 UTC) #16
lushnikov
Jeremy, thank you for your review! Talking about "FastShutdown" naming and all these "CanFastShutdown.." plumbing ...
7 years, 1 month ago (2013-11-07 17:18:09 UTC) #17
jeremy
Sorry for bugging you about comments and naming but I'm trying to get this to ...
7 years, 1 month ago (2013-11-10 12:50:28 UTC) #18
lushnikov
>I'm sure we can find a generic term which has nothing to do with DevTools ...
7 years, 1 month ago (2013-11-11 15:22:48 UTC) #19
jeremy
https://codereview.chromium.org/23835007/diff/1124001/chrome/browser/devtools/devtools_sanity_browsertest.cc File chrome/browser/devtools/devtools_sanity_browsertest.cc (right): https://codereview.chromium.org/23835007/diff/1124001/chrome/browser/devtools/devtools_sanity_browsertest.cc#newcode165 chrome/browser/devtools/devtools_sanity_browsertest.cc:165: void Wait(); nit: consider renaming to SpinMessageLoop() https://codereview.chromium.org/23835007/diff/1124001/chrome/browser/devtools/devtools_window.h File ...
7 years, 1 month ago (2013-11-12 10:52:46 UTC) #20
lushnikov
https://chromiumcodereview.appspot.com/23835007/diff/1124001/chrome/browser/devtools/devtools_sanity_browsertest.cc File chrome/browser/devtools/devtools_sanity_browsertest.cc (right): https://chromiumcodereview.appspot.com/23835007/diff/1124001/chrome/browser/devtools/devtools_sanity_browsertest.cc#newcode165 chrome/browser/devtools/devtools_sanity_browsertest.cc:165: void Wait(); On 2013/11/12 10:52:46, jeremy wrote: > nit: ...
7 years, 1 month ago (2013-11-12 13:37:36 UTC) #21
jeremy
Thank you for your patience explaining this all to me! Suggestions for comments inline. https://codereview.chromium.org/23835007/diff/1194001/chrome/browser/devtools/devtools_window.cc ...
7 years, 1 month ago (2013-11-13 10:52:33 UTC) #22
lushnikov
Thank you Jeremy for the time you've spent on reviewing this! https://codereview.chromium.org/23835007/diff/1194001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): ...
7 years, 1 month ago (2013-11-13 13:39:07 UTC) #23
jeremy
LGTM with comments. The new special cases in UnloadController strike me as very unfortunate, but ...
7 years, 1 month ago (2013-11-14 08:53:13 UTC) #24
lushnikov
Thank you for your patience! https://codereview.chromium.org/23835007/diff/1284001/chrome/browser/devtools/devtools_sanity_browsertest.cc File chrome/browser/devtools/devtools_sanity_browsertest.cc (right): https://codereview.chromium.org/23835007/diff/1284001/chrome/browser/devtools/devtools_sanity_browsertest.cc#newcode626 chrome/browser/devtools/devtools_sanity_browsertest.cc:626: // Try to exit ...
7 years, 1 month ago (2013-11-14 09:49:37 UTC) #25
lushnikov
Thank you for your patience! https://codereview.chromium.org/23835007/diff/1284001/chrome/browser/devtools/devtools_sanity_browsertest.cc File chrome/browser/devtools/devtools_sanity_browsertest.cc (right): https://codereview.chromium.org/23835007/diff/1284001/chrome/browser/devtools/devtools_sanity_browsertest.cc#newcode626 chrome/browser/devtools/devtools_sanity_browsertest.cc:626: // Try to exit ...
7 years, 1 month ago (2013-11-14 09:49:38 UTC) #26
sky
LGTM https://codereview.chromium.org/23835007/diff/1774001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/23835007/diff/1774001/chrome/browser/ui/browser.h#newcode398 chrome/browser/ui/browser.h:398: static bool ShouldRunUnloadEventsHelper(content::WebContents* contents); Why does this needs ...
7 years, 1 month ago (2013-11-14 18:50:03 UTC) #27
lushnikov
@sky, thanks for review! https://codereview.chromium.org/23835007/diff/1774001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/23835007/diff/1774001/chrome/browser/ui/browser.h#newcode398 chrome/browser/ui/browser.h:398: static bool ShouldRunUnloadEventsHelper(content::WebContents* contents); On ...
7 years, 1 month ago (2013-11-14 22:29:47 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-14 23:37:24 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 01:04:11 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 03:19:49 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 03:45:02 UTC) #32
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=190570
7 years, 1 month ago (2013-11-15 07:37:49 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 08:31:43 UTC) #34
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) nacl_integration http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=225005
7 years, 1 month ago (2013-11-15 11:09:46 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 13:29:56 UTC) #36
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) nacl_integration http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=225149
7 years, 1 month ago (2013-11-15 17:52:24 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 18:55:25 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/23835007/1774001
7 years, 1 month ago (2013-11-15 21:47:11 UTC) #39
commit-bot: I haz the power
7 years, 1 month ago (2013-11-16 00:06:36 UTC) #40
Message was sent while issue was closed.
Change committed as 235475

Powered by Google App Engine
This is Rietveld 408576698