| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. All rights reserved. | 2 * Copyright (C) 2013 Google, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #ifndef FetchInitiatorInfo_h | 26 #ifndef FetchInitiatorInfo_h |
| 27 #define FetchInitiatorInfo_h | 27 #define FetchInitiatorInfo_h |
| 28 | 28 |
| 29 #include "wtf/Allocator.h" | 29 #include "wtf/Allocator.h" |
| 30 #include "wtf/text/AtomicString.h" | 30 #include "wtf/text/AtomicString.h" |
| 31 #include "wtf/text/TextPosition.h" | 31 #include "wtf/text/TextPosition.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 struct FetchInitiatorInfo { | 35 struct FetchInitiatorInfo { |
| 36 DISALLOW_ALLOCATION(); | 36 DISALLOW_NEW(); |
| 37 FetchInitiatorInfo() | 37 FetchInitiatorInfo() |
| 38 : name() | 38 : name() |
| 39 , position(TextPosition::belowRangePosition()) | 39 , position(TextPosition::belowRangePosition()) |
| 40 , startTime(0.0) | 40 , startTime(0.0) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 // When adding members, CrossThreadFetchInitiatorInfoData should be | 44 // When adding members, CrossThreadFetchInitiatorInfoData should be |
| 45 // updated. | 45 // updated. |
| 46 AtomicString name; | 46 AtomicString name; |
| 47 TextPosition position; | 47 TextPosition position; |
| 48 double startTime; | 48 double startTime; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Encode AtomicString as String to cross threads. | 51 // Encode AtomicString as String to cross threads. |
| 52 struct CrossThreadFetchInitiatorInfoData { | 52 struct CrossThreadFetchInitiatorInfoData { |
| 53 DISALLOW_ALLOCATION(); | 53 DISALLOW_NEW(); |
| 54 explicit CrossThreadFetchInitiatorInfoData(const FetchInitiatorInfo& info) | 54 explicit CrossThreadFetchInitiatorInfoData(const FetchInitiatorInfo& info) |
| 55 : name(info.name.string().isolatedCopy()) | 55 : name(info.name.string().isolatedCopy()) |
| 56 , position(info.position) | 56 , position(info.position) |
| 57 , startTime(info.startTime) | 57 , startTime(info.startTime) |
| 58 { | 58 { |
| 59 } | 59 } |
| 60 | 60 |
| 61 operator FetchInitiatorInfo() const | 61 operator FetchInitiatorInfo() const |
| 62 { | 62 { |
| 63 FetchInitiatorInfo info; | 63 FetchInitiatorInfo info; |
| 64 info.name = AtomicString(name); | 64 info.name = AtomicString(name); |
| 65 info.position = position; | 65 info.position = position; |
| 66 info.startTime = startTime; | 66 info.startTime = startTime; |
| 67 return info; | 67 return info; |
| 68 } | 68 } |
| 69 | 69 |
| 70 String name; | 70 String name; |
| 71 TextPosition position; | 71 TextPosition position; |
| 72 double startTime; | 72 double startTime; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| 76 | 76 |
| 77 #endif | 77 #endif |
| OLD | NEW |