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

Issue 2513403003: Explicitely pass ownership of ReadingListWebStateObserverUserDataWrapper (Closed)

Created:
4 years, 1 month ago by jif
Modified:
4 years, 1 month ago
CC:
chromium-reviews, pkl (ping after 24h if needed), mac-reviews_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Explicitely pass ownership of ReadingListWebStateObserverUserDataWrapper BUG=None Committed: https://crrev.com/34145bb8726255a7da92275c2bb7bc40dda1ec14 Cr-Commit-Position: refs/heads/master@{#433821}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Addressed comment. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -3 lines) Patch
M ios/chrome/browser/reading_list/reading_list_web_state_observer.mm View 1 3 chunks +6 lines, -3 lines 2 comments Download

Messages

Total messages: 16 (9 generated)
jif
is that better?
4 years, 1 month ago (2016-11-21 18:45:26 UTC) #3
Olivier
lgtm https://codereview.chromium.org/2513403003/diff/1/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2513403003/diff/1/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode40 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:40: wrapper = newDatWrapper.get(); newDataWrapper
4 years, 1 month ago (2016-11-21 19:42:20 UTC) #4
jif-google
https://codereview.chromium.org/2513403003/diff/1/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2513403003/diff/1/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode40 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:40: wrapper = newDatWrapper.get(); On 2016/11/21 19:42:20, Olivier Robin wrote: ...
4 years, 1 month ago (2016-11-22 09:11:38 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2513403003/20001
4 years, 1 month ago (2016-11-22 09:12:06 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-11-22 09:20:26 UTC) #12
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/34145bb8726255a7da92275c2bb7bc40dda1ec14 Cr-Commit-Position: refs/heads/master@{#433821}
4 years, 1 month ago (2016-11-22 09:22:49 UTC) #14
sdefresne
4 years, 1 month ago (2016-11-22 10:01:31 UTC) #16
Message was sent while issue was closed.
drive-by

https://codereview.chromium.org/2513403003/diff/20001/ios/chrome/browser/read...
File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right):

https://codereview.chromium.org/2513403003/diff/20001/ios/chrome/browser/read...
ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:38: auto
newDataWrapper =
style: this is a C++ class, so the variable should use_cpp_naming_conventions.

On a higher level, most of the WebStateUserData inherits from
web::WebStateUserData (see ios/web/public/web_state/web_state_user_data.h).
Maybe this one should too.

I don't see when this object is created as
ReadingListWebStateObserver::FromWebState() seems to not yet be called (neither
upstream nor downstream) so I don't know if the lazily creation is a good model
for this object (i.e. code does not care whether this object exists before the
first interaction) but from its name it look like it may be interested in
capturing events as soon as the WebState is created.

If this is the case, then it is better to have an explicit construction (look
for CreateForWebState) and call it from the same location as the other
WebStateUserData (currently in downstream code).

https://codereview.chromium.org/2513403003/diff/20001/ios/chrome/browser/read...
ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:62:
ReadingListWebStateObserver* ReadingListWebStateObserver::FromWebState(
This needs a comment to remind reader this is a static method:

// static

Powered by Google App Engine
This is Rietveld 408576698