Commit 8ffc3475 authored by ichikawa's avatar ichikawa Committed by Commit bot

Add a comment and DCHECK to require |session_storage| to be non-nil in

WebState::CreateWithStorageSession().

Because it looks passing nil doesn't work. Alternatively I can update
the code to make CreateWithStorageSession(params, nil) to be equivalent
of Create(params) if you prefer.

Background:
I wrote code to expect that CreateWithStorageSession(params, nil) is
equivalent of Create(params), resulted in a weird error.

Review-Url: https://codereview.chromium.org/2802613005
Cr-Commit-Position: refs/heads/master@{#462766}
parent 32282552
...@@ -93,7 +93,8 @@ class WebState : public base::SupportsUserData { ...@@ -93,7 +93,8 @@ class WebState : public base::SupportsUserData {
// Creates a new WebState. // Creates a new WebState.
static std::unique_ptr<WebState> Create(const CreateParams& params); static std::unique_ptr<WebState> Create(const CreateParams& params);
// Creates a new WebState from a serialized NavigationManager. // Creates a new WebState from a serialized representation of the session.
// |session_storage| must not be nil.
static std::unique_ptr<WebState> CreateWithStorageSession( static std::unique_ptr<WebState> CreateWithStorageSession(
const CreateParams& params, const CreateParams& params,
CRWSessionStorage* session_storage); CRWSessionStorage* session_storage);
......
...@@ -57,6 +57,7 @@ std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { ...@@ -57,6 +57,7 @@ std::unique_ptr<WebState> WebState::Create(const CreateParams& params) {
std::unique_ptr<WebState> WebState::CreateWithStorageSession( std::unique_ptr<WebState> WebState::CreateWithStorageSession(
const CreateParams& params, const CreateParams& params,
CRWSessionStorage* session_storage) { CRWSessionStorage* session_storage) {
DCHECK(session_storage);
std::unique_ptr<WebStateImpl> web_state( std::unique_ptr<WebStateImpl> web_state(
new WebStateImpl(params, session_storage)); new WebStateImpl(params, session_storage));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment